package com.ruoyi.project.WebMoudle.shopMessage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.WebMoudle.shopMessage.mapper.ShopMessageMapper;
import com.ruoyi.project.WebMoudle.shopMessage.domain.ShopMessage;
import com.ruoyi.project.WebMoudle.shopMessage.service.IShopMessageService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 商铺消息Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-09
 */
@Service
public class ShopMessageServiceImpl implements IShopMessageService 
{
    @Autowired
    private ShopMessageMapper shopMessageMapper;

    /**
     * 查询商铺消息
     * 
     * @param id 商铺消息ID
     * @return 商铺消息
     */
    @Override
    public ShopMessage selectShopMessageById(Long id)
    {
        return shopMessageMapper.selectShopMessageById(id);
    }

    /**
     * 查询商铺消息列表
     * 
     * @param shopMessage 商铺消息
     * @return 商铺消息
     */
    @Override
    public List<ShopMessage> selectShopMessageList(ShopMessage shopMessage)
    {
        return shopMessageMapper.selectShopMessageList(shopMessage);
    }

    /**
     * 新增商铺消息
     * 
     * @param shopMessage 商铺消息
     * @return 结果
     */
    @Override
    public int insertShopMessage(ShopMessage shopMessage)
    {
        shopMessage.setCreateTime(DateUtils.getNowDate());
        return shopMessageMapper.insertShopMessage(shopMessage);
    }

    /**
     * 修改商铺消息
     * 
     * @param shopMessage 商铺消息
     * @return 结果
     */
    @Override
    public int updateShopMessage(ShopMessage shopMessage)
    {
        shopMessage.setUpdateTime(DateUtils.getNowDate());
        return shopMessageMapper.updateShopMessage(shopMessage);
    }

    /**
     * 删除商铺消息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShopMessageByIds(String ids)
    {
        return shopMessageMapper.deleteShopMessageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商铺消息信息
     * 
     * @param id 商铺消息ID
     * @return 结果
     */
    @Override
    public int deleteShopMessageById(Long id)
    {
        return shopMessageMapper.deleteShopMessageById(id);
    }

    @Override
    public int addSomeMsg(List<ShopMessage> list) {
        return shopMessageMapper.addSomeMsg(list);
    }

    @Override
    public int myMessageCount(Long shopId) {
        return shopMessageMapper.myMessageCount(shopId);
    }

    @Override
    public List<ShopMessage> queryMyMsgList(Long shopId) {
        return shopMessageMapper.queryMyMsgList(shopId);
    }

    @Override
    public int markYiDu(Long smId) {
        return shopMessageMapper.markYiDu(smId);
    }
}
